<?php

class phpThumbCreator {

	
	private $_adapter;
	
	
	public function __construct() {
		// do nothing important here
	}
	
	public function setAdapter($value) {
		if ($value instanceof InterfacePhpthumb) {
			$this->_adapter = $value;
		} else {
			throw new Exception ( 'Invalid Adapter class' );
		}
	}
	public function SourceFileDest($sourcepath){
		if ($this->_adapter == null)
			throw new Exception ();
		$result = $this->_adapter->setSourceFileDest($sourcepath);
		return $result;
		
	}
	
	public function ThumbFileDest($thumbpath){
		if ($this->_adapter == null)
			throw new Exception ();
		$result = $this->_adapter->setThumbFileDest ($thumbpath);
		return $result;	
	}
	public function ThumbFileDimensions($thumbw, $thumbh){
		
		if ($this->_adapter == null)
			throw new Exception ();
		$result = $this->_adapter->setThumbFileDimensions ($thumbw,$thumbh);
		return $result;	
		
	} 
	public function getSourcePath() {
		if ($this->_adapter == null)
				throw new Exception ();
	
		$sourceFile = $this->_adapter->SourcePath();
		return $sourceFile;
		
	}
	public function CreateThumbImage(){
		if ($this->_adapter == null)
				throw new Exception ();
	
		$thumb = $this->_adapter->CreateThumb();
		return $thumb;
	}
	
	
}
